using System;
using System.Management.Automation.Host;

namespace Fines.Powershell.PowershellMSBuildTask
{
    /// <summary>
    /// Implementation of PSHostRawUserInterface.
    /// Only the BackgroundColor and ForegroundColor properties are implemented, the rest
    /// are not needed and don't make much sense in an MSBuild task.
    /// </summary>
    public class PowershellHostRawUI : PSHostRawUserInterface
    {
        public override ConsoleColor BackgroundColor
        {
            get
            {
                return ConsoleColor.Black;
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override Size BufferSize
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override Coordinates CursorPosition
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override int CursorSize
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override void FlushInputBuffer()
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override ConsoleColor ForegroundColor
        {
            get
            {
                return ConsoleColor.White;
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override BufferCell[ , ] GetBufferContents( Rectangle rectangle )
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override bool KeyAvailable
        {
            get { throw new Exception( "The method or operation is not implemented." ); }
        }

        public override Size MaxPhysicalWindowSize
        {
            get { throw new Exception( "The method or operation is not implemented." ); }
        }

        public override Size MaxWindowSize
        {
            get { throw new Exception( "The method or operation is not implemented." ); }
        }

        public override KeyInfo ReadKey( ReadKeyOptions options )
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override void ScrollBufferContents( Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill )
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override void SetBufferContents( Rectangle rectangle, BufferCell fill )
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override void SetBufferContents( Coordinates origin, BufferCell[ , ] contents )
        {
            throw new Exception( "The method or operation is not implemented." );
        }

        public override Coordinates WindowPosition
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override Size WindowSize
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }

        public override string WindowTitle
        {
            get
            {
                throw new Exception( "The method or operation is not implemented." );
            }
            set
            {
                throw new Exception( "The method or operation is not implemented." );
            }
        }
    }
}
